package phoeics.authoryserver.webservice.entity;

import java.io.Serializable;
import javax.persistence.*;

import phoeics.authoryserver.webservice.entity.listener.OauthUserListener;

import java.util.List;


/**
 * The persistent class for the oauth_user database table.
 * 
 */
@Entity
@Table(name="oauth_user")
@NamedQuery(name="OauthUser.findAll", query="SELECT o FROM OauthUser o")
@EntityListeners(OauthUserListener.class)
public class OauthUser implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;

	private String email;

	private String password;

	private String username;

	//bi-directional many-to-many association to OauthRole
	@ManyToMany(mappedBy="oauthUsers")
	private List<OauthRole> oauthRoles;

	public OauthUser() {
	}

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public List<OauthRole> getOauthRoles() {
		return this.oauthRoles;
	}

	public void setOauthRoles(List<OauthRole> oauthRoles) {
		this.oauthRoles = oauthRoles;
	}

}